// 集中存放，路由映射关系的数据包
// 可以用于动态生成Route、菜单
import {
  AreaChartOutlined,
  RadarChartOutlined,
  HeatMapOutlined,
  MediumOutlined
} from "@ant-design/icons";
import DashBoard from '../views/DashBoard'
import CfyList from '../views/Classify/CfyList'
import CfyPublic from '../views/Classify/CfyPublic'
import GoodsPublic from '../views/Goods/GoodsPublic'
import GoodsList from '../views/Goods/GoodsList'
import BannerPublic from "../views/Banner/BannerPublic";
import BannerList from "../views/Banner/BannerList";
import BannerEdit from "../views/Banner/BannerEdit";
import RoleManager from "../views/System/RoleManager";
import UserManager from "../views/System/UserManager";
import NotFound from "../views/NotFound";
import RangeMap from "../views/RangeMap";

export let adminRoutes = [
  {
    path:'/admin/dashboard',
    component:DashBoard,
    title:'数据图表',
    icon:<AreaChartOutlined />,
    roles:['root']
  },
  {
    path:'/admin/cfy',
    title:'分类管理',
    icon:<RadarChartOutlined />,
    roles:['root','admin'],
    children:[
      {
        path:'/admin/cfy/list',
        component:CfyList,
        title:'分类列表',
        roles:['root','admin']
      },
      {
        path:'/admin/cfy/pub',
        component:CfyPublic,
        title:'分类发布',
        roles:['root'],
      },
    ]
  },
  {
    path:'/admin/banner',
    title:'轮播管理',
    icon:<RadarChartOutlined />,
    roles:['root','admin'],
    children:[
      {
        path:'/admin/banner/list',
        component:BannerList,
        title:'Banner列表',
        roles:['root','admin'],
      },
      {
        path:'/admin/banner/pub',
        component:BannerPublic,
        title:'Banner发布',
        roles:['root','admin'],
      },
      {
        path:'/admin/banner/edit',
        component:BannerEdit,
        roles:['root','admin'],
      },
    ]
  },
  {
    path:'/admin/goods',
    title:'商品管理',
    icon:<HeatMapOutlined />,
    roles:['root','admin'],
    children:[
      {
        path:'/admin/goods/list',
        component:GoodsList,
        title:'商品列表',
        roles:['root','admin'],
      },
      {
        path:'/admin/goods/pub',
        component:GoodsPublic,
        title:'发布商品',
        roles:['root','admin'],
      }
    ]
  },
  {
    path:'/admin/map',
    component:RangeMap,
    title:'配送范围',
    icon:<MediumOutlined />,
    roles:['root','admin']
  },
  {
    path:'/admin/sys',
    title:'系统管理',
    icon:<HeatMapOutlined />,
    roles:['root'],
    children:[
      {
        path:'/admin/sys/role',
        component:RoleManager,
        title:'角色管理',
        roles:['root'],
      },
      {
        path:'/admin/sys/user',
        component:UserManager,
        title:'用户管理',
        roles:['root'],
      }
    ]
  },
  {
    path:'*',
    component:NotFound,
    roles:['root','admin']
  }
]